package xyz.zhno.factory.abstracts;

/**
 * 模拟客户端
 * @author zh_o
 * @date 2020-11-14
 */
public class Client {

    public static void main(String[] args) {

        System.out.println("============= Xiaomi =============");
        XiaomiProductFactory xiaomiProductFactory = new XiaomiProductFactory();
        PhoneProduct xiaomiPhone = xiaomiProductFactory.createPhone();
        xiaomiPhone.start();
        xiaomiPhone.call();
        RouterProduct xiaomiRouter = xiaomiProductFactory.createRouter();
        xiaomiRouter.openWifi();

        System.out.println("============= Huawei =============");
        HuaweiProductFactory huaweiProductFactory = new HuaweiProductFactory();
        PhoneProduct huaweiPhone = huaweiProductFactory.createPhone();
        huaweiPhone.start();
        huaweiPhone.call();
        RouterProduct huaweiRouter = huaweiProductFactory.createRouter();
        huaweiRouter.openWifi();
    }

}
